package com.kawa.controller;

import com.kawa.entity.po.User;
import com.kawa.mapper.TestMapper;
import com.kawa.model.R;
import com.mybatisflex.core.query.QueryWrapper;
import org.apache.tomcat.util.log.UserDataHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

import static com.kawa.entity.po.table.UserTableDef.USER;


/**
 * @Author: KAIyo
 * @Date: 2025/7/18 10:35
 * @Version: v1.0.0
 * @Description: TODO
 **/
@RestController
@ResponseBody
@RequestMapping("/test")
public class TestController {

    @Autowired
    private TestMapper testMapper;

    @RequestMapping("/test")
    public R<List<User>> test() {
        QueryWrapper queryWrapper = QueryWrapper.create()
                .select()
                .where(USER.USERNAME.eq("zhangsan"));


        return R.ok(testMapper.selectAll());

    }
}
